<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/27 0027
 * Time: 下午 8:00
 */
namespace app\common\model;

use think\Model;

class Tenant extends BaseModel{
    protected $resultSetType = 'collection';

    const IS_TDT_0 = 0;//是否设置过物流配送  1已设置 0 未设置
    const IS_TDT_1 = 1;
    /**
     * @return \think\model\relation\HasOne
     * 获取商户店铺关联
     */
    public function Stores()
    {
        return $this->hasMany('store','tenantId','id');
    }

    /**
     * @return \think\model\relation\HasOne
     * 获取商户店铺关联
     */
    public function tenantdistributiontype()
    {
        return $this->hasMany('tenantdistributiontype','tenantId','id');
    }

    public function getTenant($TenantId){
           return self::where(array(
                    "id"=>$TenantId
            ))->find();
    }


}